//
//  MJNewsListModel.m
//  TestAfn2
//
//  Created by xujingjing on 16/6/16.
//  Copyright © 2016年 xujingjing. All rights reserved.
//

#import "MJNewsListModel.h"
#import "MJhealthModel.h"

@interface MJNewsListModel()


@end



@implementation MJNewsListModel

- (void)getDataSourceModle{
    
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        
        [TestAfnetHttp postWithUrl:[NSString stringWithFormat:@"%@?num=%@",API_URL,@"10"] paramters:nil success:^(id response) {
            
            //  NSLog(@"api请求－>:%@",response);
            
            NSMutableArray* newslist = [NSMutableArray array];
            
            
            for (NSDictionary *subDic in response[@"newslist"]) {
                [newslist addObject:[MJhealthModel mj_objectWithKeyValues:subDic]];
            }
            
            
            self.dataSource = newslist;
            
            
            
            
        } failed:^(id error) {
            
            NSLog(@"error->%@",error);
            self.dataSource = error;
            
        }];

        
    });
    
    
    
    
    
}

@end
